/**
 * Project Name:fastPlat
 * File Name:AttachFilesServiceImpl.java
 * Package Name:com.fast.cms.service.article.impl
 * Date:2017年06月04日 21时40分21秒
 * Copyright (c) 2017, lsflu@126.com All Rights Reserved.
 *
*/

package com.fast.cms.service.article.impl;

import org.springframework.stereotype.Service;

import com.fast.base.dao.daoSuport.JpaDaoSupport;
import com.fast.base.db.page.PageView;
import com.fast.base.db.page.QueryResult;
import com.fast.cms.service.article.AttachFilesService;
import com.fast.cms.web.form.AttachFilesForm;
import com.fast.cms.model.article.AttachFiles;

/**
 * ClassName:AttachFilesServiceImpl <br/>
 * 用途: AttachFiles服务实现 <br/>
 * 开发人员：lushuifa  http://lushuifa.iteye.com/
 * 邮箱:lsflu@126.com
 * @version  1.0
 * @since    JDK 1.6
 * @see
 * Date:     2017年06月04日 21时40分21秒 <br/> 	 
 */
@Service("attachFilesService")
public class AttachFilesServiceImpl extends JpaDaoSupport implements AttachFilesService {

    /**
	 * 分页获取AttachFiles列表
	 * @return PageView<AttachFiles>
	 */
	@Override
	public PageView<AttachFiles> getAttachFilesList(AttachFilesForm attachFilesForm){
		StringBuffer sb = new StringBuffer(" where 1=1 ");
		sb.append("and delete_flag="+attachFilesForm.getDeleteFlag()+" ");
		String ordersql = " order by edit_time desc ";
		QueryResult<AttachFiles>  queryResult = super.queryForBeanListByPage(AttachFiles.class,sb.toString(),ordersql,(attachFilesForm.getPage()-1)*attachFilesForm.getRows(),attachFilesForm.getRows());
		PageView<AttachFiles> pageView = new PageView<AttachFiles>();
	    pageView.setCurrentPage(attachFilesForm.getPage());
		pageView.setQueryResult(queryResult);
 		return pageView;
	}
}

